﻿using Common.Infrastructure;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Common.EF.Map
{
    public class EntityBaseMap<T> : IEntityTypeConfiguration<T> where T : EntityBase
    {
        public virtual void Configure(EntityTypeBuilder<T> builder)
        {
            builder.Property(t => t.id).HasMaxLength(50);
            builder.HasKey(t => t.id);
            builder.Property(t => t.create_time);
            builder.Property(t => t.modify_time);
            builder.Property(t => t.org_id).HasMaxLength(50);
            builder.HasIndex(t => t.create_time);
        }
    }
}
